#include <iostream>
using namespace std;
struct A {
  int a = 10;
};
class B {
  int b = 20;

 public:
  int c = 30;
};
struct C : A {};
// struct D : B {  // 不写继承方式，就默认public继承
class D : B {  // 不写继承方式，就默认private继承
  int Getc() { return c; }
};
void test1() {
  A a1;
  B b1;
  cout << a1.a << endl;
  // cout << b1.b << endl;  // 编译错误，默认访问控制权限为private
  C c1;
  D d1;
  cout << c1.a << endl;
  cout << d1.c << endl;
  // cout << d1.Getc() << endl;
}
int main() {
  test1();
  return 0;
}